Improve "dirty" error message
authorJan Likar <likar.jan@gmail.com>
Sun, 9 Apr 2017 02:20:41 +0000 (04:20 +0200)
committerJan Likar <likar.jan@gmail.com>
Sun, 9 Apr 2017 02:48:51 +0000 (04:48 +0200)
Improve the error message stating the working directory has dirty
files (files not yet committed).

Fix #3876.

src/cargo/ops/cargo_package.rs
tests/package.rs
tests/publish.rs

index b0897b0796735e5b43992c528012f95119ee7e15..107a4f2a55462f13e02a6aa66e9312d18946da98 100644 (file)
@@ -173,7 +173,8 @@ fn check_not_dirty(p: &Package, src: &PathSource) -> CargoResult<()> {
         if dirty.is_empty() {
             Ok(())
         } else {
-            bail!("{} dirty files found in the working directory:\n\n{}\n\n\
+            bail!("{} files in the working directory contain changes that were \
+                   not yet committed into git:\n\n{}\n\n\
                    to proceed despite this, pass the `--allow-dirty` flag",
                   dirty.len(), dirty.join("\n"))
         }
index fab868061d59839ea019353f46a708b5b416926c..cbcf1468385aef39b61d61c0334dbbaba3ac73de 100644 (file)
@@ -580,7 +580,8 @@ fn do_not_package_if_repository_is_dirty() {
     assert_that(p.cargo("package"),
                 execs().with_status(101)
                        .with_stderr("\
-error: 1 dirty files found in the working directory:
+error: 1 files in the working directory contain changes that were not yet \
+committed into git:
 
 Cargo.toml
 
index 84b3ea128d31429bcb63e34633b683ffefd0c842..1e4d71400aad9f681dfc4bdeb9164a8352832cb8 100644 (file)
@@ -207,7 +207,8 @@ fn dont_publish_dirty() {
                  .arg("--host").arg(registry().to_string()),
                 execs().with_status(101).with_stderr("\
 [UPDATING] registry `[..]`
-error: 1 dirty files found in the working directory:
+error: 1 files in the working directory contain changes that were not yet \
+committed into git:
 
 bar